<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="mainMenu.title"/></title>
    <meta name="heading" content="<fmt:message key='mainMenu.heading'/>"/>
    <meta name="menu" content="MainMenu"/>
</head>

<p><fmt:message key="mainMenu.message"/></p>

<div class="separator"></div>


<table style="text-align: left; width: 100%;" border="0"
 cellpadding="0" cellspacing="0" >
  <tbody>
    <tr>
      <td width="30%" valign="top">
      <table style="text-align: left; width: 100%;" border="1"
 cellpadding="2" cellspacing="2" class="table">
        <tbody>
          <tr>
            <td><c:out value="${user.name}"/></td>
          </tr>
          <tr>
            <td>
		        <c:choose>
		            <c:when test="${user.gender == 'true'}">
		                <fmt:message key="user.male"/>
		            </c:when>
		            <c:otherwise>
		                <fmt:message key="user.female"/>
		            </c:otherwise>
		        </c:choose>
            </td>
          </tr>
          <tr>
            <td><c:out value="${user.birthday}"/></td>
          </tr>
          <tr>
            <td><c:out value="${user.username}"/></td>
          </tr>
          <tr>
            <td><c:out value="${user.email}"/></td>
          </tr>
          <tr>
            <td><c:out value="${user.relative}"/></td>
          </tr>
          <tr>
            <td><c:out value="${user.address.fullAddress}"/></td>
          </tr>
          <tr>
            <td><c:out value="${user.memo}"/></td>
          </tr>
        </tbody>
      </table>
      </td>
<c:if test="${not empty therapy.id}">

      <td valign="top">
      <table style="text-align: left; width: 100%;" border="1"
 cellpadding="0" cellspacing="0" class="table">
        <tbody>
          <tr>
            <td colspan="2" rowspan="1">
            <table style="text-align: left; width: 100%;"
 border="1" cellpadding="0" cellspacing="0">
              <tbody>
                <tr>
                  <td><c:out value="${therapy.dateStr}"/></td>
                </tr>
                <tr>
                  <td style="line-height:20px;"><c:out value="${therapy.synptom}"/></td>
                </tr>
                <tr>
                   <td  style="line-height:20px;"><c:out value="${therapy.tonguepulse}"/></td>
                </tr>
                <tr>
                  <td  style="line-height:20px;"><c:out value="${therapy.formulaStr}" escapeXml="false"/></td>
                </tr>
                <tr>
                  <td style="line-height:20px;"><c:out value="${therapy.dosage}" /></td>
                </tr>
                <tr>
                  <td style="line-height:20px;"><c:out value="${therapy.doctor.name}" /></td>
                </tr>
                <tr>
                  <td><fmt:message key="feedBackDetail.heading"/></td>
                </tr>                  
                <tr>
                   <td  style="line-height:20px;">
			           <c:forEach var="feedback" items="${therapy.feedbacks}" >
				          <c:out value="${feedback.fdate}"/>
			 	          <c:choose>
				       		<c:when test="${feedback.author}">
				    			<c:out value="${feedback.doctor.name}"/>
				    		</c:when>
				    		<c:otherwise>
				    			<c:out value="${feedback.patient.name}"/>
				    		</c:otherwise>
				    	  </c:choose>				          
			 	          <c:choose>
				       		<c:when test="${feedback.isGood}">
				    			<img src="<c:url value="/images/good.gif"/>" class="icon"/>
				    		</c:when>
				    		<c:otherwise>
				    			<img src="<c:url value="/images/bad.gif"/>" class="icon"/>
				    		</c:otherwise>
			    		  </c:choose>
				          <c:out value="${feedback.contentStr}" escapeXml="false"/>
				          <br>
			          </c:forEach>                                      
                   
                   </td>
                </tr>
                <tr align="center">
                  <td colspan="2" rowspan="1"><input type="button" style="margin-right: 5px"
        onclick="location.href='<c:url value="/feedbackform.html?f=m&therapy.id="/><c:out value="${therapy.id}"/>'"
        value="<fmt:message key="menu.feedback"/>"/></td>
                </tr>
              </tbody>
            </table>
            </td>
          </tr>
          <tr>
            <td colspan="2" rowspan="1">
	            <fmt:message key="therapy.history"/>
			</td>
          </tr>
          <tr>
            <td><fmt:message key="therapy.tdate"/></td>
            <td><fmt:message key="therapy.synptom"/></td>
          </tr>
          
          <c:forEach var="therapy" items="${therapyList}" >
          <tr>
            <td><c:out value="${therapy.dateStr}"/></td>
            <td><a href='<c:url value="/therapydetail.html?p="/><c:out value="${therapy.id}"/>&u=<c:out value="${therapy.patient.id}"/>'>
            <c:out value="${therapy.synptom}"/></a>
            </td>
          </tr>
          </c:forEach>

        </tbody>
      </table>
      </td>
</c:if>
    </tr>
  </tbody>
</table>



